<!-- 
  @name: 扫码加注(完成)
  @date: 2020.4.7
 -->
<template>
	<view class="content">
		<view class="icon">
			<view class="i"></view>
		</view>
		
		<view class="info">
			<!-- <view class="item">
				<view class="left">实际加注金额</view>
				<view class="right">{{info.moneyFill}}元</view>
			</view> -->
			<view class="item">
				<view class="left">实际加注量</view>
				<view class="right">{{info.actualNum}}<text v-text="info.units === 0 ? 'L' : 'kg'"></text></view>
			</view>
			<!-- <view class="item">
				<view class="left">加注时间</view>
				<view class="right">{{info.finishTime}}</view>
			</view> -->
			<view class="item" v-if="info.compcode === 1 || info.compcode === 3 || info.compcode === 4">
				<view class="left">加注时间</view>
				<view class="right">
					<text v-if="info.compcode === 1">3分钟内未提枪加注</text>
					<text v-else-if="info.compcode === 3">运营商接单失败</text>
					<text v-else-if="info.compcode === 4">加注机因故障停止</text>
				</view>
			</view>
		</view>
		
		<button class="btn_submit" @tap="submit">确认</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {},  //订单信息
			}
		},
		onLoad() {
			this.getOrder();
		},
		methods: {
			//确认
			submit() {
				uni.navigateBack();
			},
			//获取订单信息
			getOrder() {
				this.info = JSON.parse(this.$store.state.tmpData);
				this.$store.commit('setTmpData', '');
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: $color-white;
	}
	
	.icon {
		width: 100%;
		margin-top: 50rpx;
		display: flex;
		justify-content: center;
		.i {
			width: 240rpx;
			height: 245rpx;
			background-image: url('http://img.etubang.com/group1/M00/00/42/rBCky16MOGiAd0QZAABWuBx5k8M075.png');
		}
	}
	
	.info {
		width: 100%;
		margin-top: 90rpx;
		padding: 0 40rpx;
		.item {
			width: 100%;
			margin-top: 40rpx;
			display: flex;
			flex-direction: row;
			align-items: center;
			.left {
				flex: 1;
			}
			.right {
				color: $color-text-primary;
			}
		}
	}
	
	.btn_submit {
		margin-top: 130rpx;
	}
	
</style>
